//package sing.core.ext.download
//
//import sing.core.ext.util.showShort
//import okhttp3.ResponseBody
//import retrofit2.Response
//import retrofit2.http.*
//import java.io.File
//
//interface DownLoadService {
//    @Streaming
//    @GET
//    suspend fun downloadFile(
//        @Header("RANGE") start: String,
//        @Url url: String
//    ): Response<ResponseBody>
//
//    // GET
////    val fileName = Global.getDownloadName("png")
////    GlobalScope.launch(Dispatchers.Main) {//开始协程：主线程
////        DownLoadManager.downLoad("tag","下载地址","下载目录","文件名.png",true,object : OnDownLoadListener {
////            override fun onDownLoadPrepare(key: String) {
////            }
////
////            override fun onDownLoadError(key: String, throwable: Throwable) {
////                dismissLoading()
////                "保存失败".showShort()
////                File("${Global.getImageFilePath()}/${fileName}").delete()
////            }
////
////            override fun onDownLoadSuccess(key: String, path: String, size: Long) {
////                dismissLoading()
////                "保存成功".showShort()
////            }
////
////            override fun onDownLoadPause(key: String) {
////            }
////
////            override fun onUpdate(key: String, progress: Int, read: Long, count: Long, done: Boolean) {
//////                    "$progress".loge("123123123123123")
////            }
////        })
////    }
//
//    @Streaming
//    @FormUrlEncoded
//    @POST
//    suspend fun downloadFile(
//        @Header("RANGE") start: String,
//        @Url url: String,
//        @Field("key") key: String
//    ): Response<ResponseBody>
//
//    // POST 实例
////    val fileName = Global.getDownloadName("png")
////    GlobalScope.launch(Dispatchers.Main) {//开始协程：主线程
////        DownLoadManager.downLoad("tag","接口下载地址","下载目录","文件名.png",true,"参数，自己定义，对应50行的相关",object : OnDownLoadListener {
////            override fun onDownLoadPrepare(key: String) {
////            }
////
////            override fun onDownLoadError(key: String, throwable: Throwable) {
////                dismissLoading()
////                "保存失败".showShort()
////                File("${Global.getImageFilePath()}/${fileName}").delete()
////            }
////
////            override fun onDownLoadSuccess(key: String, path: String, size: Long) {
////                dismissLoading()
////                "保存成功".showShort()
////            }
////
////            override fun onDownLoadPause(key: String) {
////            }
////
////            override fun onUpdate(key: String, progress: Int, read: Long, count: Long, done: Boolean) {
//////                    "$progress".loge("123123123123123")
////            }
////        })
////    }
//}